home *** CD-ROM | disk | FTP | other *** search
- Path: news.texas.net!usenet
- From: Michael Douglass <mikedoug@texas.net>
- Newsgroups: comp.lang.c
- Subject: Re: #define, question from a beginner
- Date: Mon, 05 Feb 1996 13:38:09 -0600
- Organization: Texas Networking, Inc.
- Message-ID: <31165CA1.2781E494@texas.net>
- References: <ma-010296161301@mac147.maths.uwa.edu.au> <31109AF8.423B@zess.uni-siegen.de> <TANMOY.96Feb1095641@qcd.lanl.gov>
- NNTP-Posting-Host: millenium.texas.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4m)
-
- Tanmoy Bhattacharya wrote:
- >
- > In article <31109AF8.423B@zess.uni-siegen.de> Markus Becker
-
- > > #define fiveLines printf("%d, ",j); \ // macro should include
- > this first ==== here
- > > /* comment is part of the macro \ // <- and here
- > > the comment contains a few lines \ // <- and here
- >
- > and so on.
-
- > Second, a comment can never be a part of a macro, because each comment
- > is treated as a single space before macros are recognized or
- > expanded. (Or rather, by the `as if' rule: the _meaning_ of the
- > program is as if the comments were replaced by spaces early on.) The \
- > followed by newline (NOT \ followed by spaces followed by newline or \
- > followed by // or other junk) is deleted even before the comment
- > processing (but after the trigraph processing so that ??/ followed by
- > newline is as good as \ followed by newline).
-
- What I'm trying to figure out is *why* you want to include comments
- inside of a macro anyways... The only thing that would see the expanded
- version w/ comments would be the compiler after preprocessing... Which
- would then barf on comments because the preprocessor takes the comments
- out... (Doesn't it?)
-
- --
- Michael Douglass
- Texas Networking, Inc.
-
- "I didn't change a thing and from the moment I didn't change it,
- it doesn't work anymore." -- Anonymous
-